<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查询弹窗</title>
    <link rel="stylesheet" href="../../lib/layui/css/layui.css">
    <link rel="stylesheet" href="../../css/oksub.css">
</head>
<body>
<div class="layui-row" style="margin-right: 10px">
    <form class="layui-form ok-form">

        <div class="layui-form-item">
            <label class="layui-form-label">警情编号</label>
            <div class="layui-input-block">
                <input type="text" id="caseId" name="title" lay-verify="title" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">督办级别</label>
            <div class="layui-input-block">
                <select name="reportingLevel" id="procLevel" lay-filter="aihao">
                    <option value=""></option>
                    <option value="一级">一级</option>
                    <option value="二级">二级</option>
                    <option value="三级">三级</option>
                    <option value="四级">四级</option>
                    <option value="五级">五级</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">警情描述</label>
            <div class="layui-input-block">
                <input type="text" id="caseDescription" name="username" placeholder="警情描述" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">起始时间</label>
            <div class="layui-input-block">
                <input type="text" placeholder="起始时间" id="startTime" name="date1" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">终止时间</label>
            <div class="layui-input-block">
                <input type="text" placeholder="终止时间" id="endTime" name="date2"  autocomplete="off" class="layui-input">
            </div>
        </div>

        <button class="layui-btn" lay-submit="" lay-filter="search"
                style="margin-top:15px;margin-right: 15px;float: right">
            <i class="layui-icon layui-icon-search"></i>
        </button>
    </form>
</div>

<script src="../../lib/layui/layui.js"></script>
<script src="../../js/jquery.min.js"></script>
<script src="../../js/application.js"></script>
<script>

</script>
<script>
    layui.use(["table", 'laydate', 'form',], function () {
        let $ = layui.jquery;
        let table = layui.table;
        let form = layui.form;
        let laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#startTime',
            trigger: 'click'
        });

        laydate.render({
            elem: '#endTime',
            trigger: 'click'
        });

        let storage = window.localStorage;
        storage.skin = "1";
        storage.anim = "5";

    })


    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(search)', function(data){
            //获取输入的值
            let caseId =document.getElementById("caseId").value;
            let procLevel =document.getElementById("procLevel").value;
            let caseDescription =document.getElementById("caseDescription").value;
            let startTime=document.getElementById("startTime").value;
            let endTime=document.getElementById("endTime").value;

            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            //将获取到的值穿到父级页面
            window.parent.document.isChange=1
            window.parent.document.caseId=caseId
            window.parent.document.procLevel=procLevel
            window.parent.document.caseDescription=caseDescription
            window.parent.document.startTime=startTime
            window.parent.document.endTime=endTime
            parent.layer.close(index);//关闭当前iframe
            return false;
        });
    });
</script>
</body>
</html>